#!/usr/bin/env bash

docker container inspect mongo > /dev/null  2>&1

if [ $? -eq 0 ]; then
		echo "skip docker mongo"
		exit
fi

host=$1
if [ -z "$host" ]
then
  host='http://dev8.cn:8008/api/ops/docker'
fi

docker build -t mongo-dev -f mongo.Dockerfile .

docker volume create mongo_data

docker run --name mongo -dt -p 8017:27017  \
-e MONGO_INITDB_ROOT_PASSWORD=yxh123  \
-v mongo_data:/data \
mongo-dev

# curl -fsSL http://dev8.cn:8000/static/ops/docker-mongo.sh | bash
